<div class="users index">
    <h2><?php __('Avaliadores e Coordenadores'); ?></h2>
    <p>
        <?php
        echo $paginator->counter(array(
            'format' => __('Página %page% de %pages%, mostrando %current% registros de %count% no total, do %start% ao %end%', true)
        ));
        ?></p>
    <table cellpadding="0" cellspacing="0">
        <tr>
            <th><?php echo $paginator->sort('id'); ?></th>
            <th><?php echo $paginator->sort('Nome de Usuário','username'); ?></th>
<!--            <th><?php //echo $paginator->sort('password'); ?></th>-->
            <th><?php echo $paginator->sort('Grupo','group_id'); ?></th>
            <th class="actions"><?php __('Ações'); ?></th>
        </tr>
        <?php
        $i = 0;
        foreach ($users as $user):
            $class = null;
            if ($i++ % 2 == 0) {
                $class = ' class="altrow"';
            }
        ?>
            <tr<?php echo $class; ?>>
                <td>
                <?php echo $user['User']['id']; ?>
            </td>
            <td>
                <?php echo $user['User']['username']; ?>
            </td>
<!--            <td>
                <?php //echo $user['User']['password']; ?>
            </td>-->
            <td>
                <?php echo $html->link($user['Group']['name'], array('controller' => 'groups', 'action' => 'view', $user['Group']['id'])); ?>
            </td>
            <td class="actions">
                <?php echo $html->link(__('Ver', true), array('action' => 'view', $user['User']['id'])); ?>
                <?php echo $html->link(__('Editar', true), array('action' => 'edit', $user['User']['id'])); ?>
                <?php echo $html->link(__('Excluir', true), array('action' => 'delete', $user['User']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $user['User']['id'])); ?>
            </td>
        </tr>
        <?php endforeach; ?>
            </table>

            <div class="paging">
        <?php echo $paginator->prev('<< ' . __('anterior', true), array(), null, array('class' => 'disabled')); ?>
                | 	<?php echo $paginator->numbers(); ?>
        <?php echo $paginator->next(__('próxima', true) . ' >>', array(), null, array('class' => 'disabled')); ?>
            </div>
        </div>        
        <div class="actions">
            <ul>
                <li><?php echo $html->link(__('Adicionar Usuário', true), array('action' => 'add')); ?></li>
                <li><?php echo $html->link(__('Listar Grupos', true), array('controller' => 'groups', 'action' => 'index')); ?> </li>
                <li><?php echo $html->link(__('Adicionar Grupo', true), array('controller' => 'groups', 'action' => 'add')); ?> </li>
    </ul>
</div>
